{include file="public/header"/}
 
<div id="container" >


    <div id="page-header" class="am-cf">

        <div class="button">
            <a onclick="addtab()" class="am-btn am-btn-xs am-btn-primary" data-pjax><i class="am-icon-plus"></i> 添加tab</a>
        </div>
    </div>

  
  
  
   <section class="panel" style="width: 98%;margin: 5px auto;">
     <table class="table">

            <tr>
                <th>tab名称</th>
                <th>操作</th>
            </tr>
           {foreach $tablist as $v}
            <tr>
                <td>{$v.title}</td>
               
                <td>
                    <a onclick="addtab({$v.tid})" class='am-badge am-badge-primary'><i class='am-icon-edit'></i> 编辑</a><a onclick="getdelete({$v.tid})" class='am-badge am-badge-danger'> <i class='am-icon-recycle'></i> 删除</a>
                </td>
            </tr>
            {/foreach}

        </table>
      
    </section>     
  
</div>

<script>
  
  
  

  function addtab(id){

     layer.open({
            type: 2,
            title: '编辑',
            area: ['800px', '560px'],
            shade: false,
            content: '/admin/index/editertab?tid='+id
        });
  }
  
  function getdelete(id){
    $.ajax({
      url:'/admin/set/getdeleteTab',
      type:'post',
      data:{tid:id},
      success:function(res){
           if(res.code == 0){
              layer.msg(res.msg,{icon:1,end:function(){
                location.reload();
              }});
           }
       }
    });
  }



</script>


{include file="public/footer"/}
